home *** CD-ROM | disk | FTP | other *** search
/ HamCall (April 1991) / HAMCALL CD-ROM (Buckmaster)(April 1991).BIN / prgming / ctutor / charout.c < prev    next >
Text File  |  1990-10-14  |  772b  |  36 lines

  1.                                          /* Chapter 10 - Program 2 */
  2. #include "stdio.h"
  3. main()
  4. {
  5. FILE *point;
  6. char others[35];
  7. int indexer,count;
  8.  
  9.    strcpy(others,"Additional lines.");
  10.    point = fopen("tenlines.txt","a"); /* open for appending */
  11.  
  12.    for (count = 1;count <= 10;count++) {
  13.       for (indexer = 0;others[indexer];indexer++)
  14.          putc(others[indexer],point);  /* output a single character */
  15.       putc('\n',point);                /* output a linefeed */
  16.    }
  17.    fclose(point);
  18. }
  19.  
  20.  
  21.  
  22. /* Result of output (appended to TENLINES.TXT)
  23.  
  24. Additional lines.
  25. Additional lines.
  26. Additional lines.
  27. Additional lines.
  28. Additional lines.
  29. Additional lines.
  30. Additional lines.
  31. Additional lines.
  32. Additional lines.
  33. Additional lines.
  34.  
  35. */
  36.